<template>
	<view :class="[empty ? '' : 'padding-lr-sm']">

		<!-- 空白页 -->
		<use-empty v-if="empty" e-style="round" e-type="cart" :btn-tip="false" tip="暂无记录"></use-empty>

		<view v-else class="padding bg-main border-radius margin-top-sm pos-r" v-for="(item, idx) in datas" :key="idx">
			<view class="dflex-b ">
				<view class="dflex">
					<view class="">
						<view class="fwbd">
							编号:{{ item.makerId }}
						</view>
						<!-- <view class="fs-xxs ft-dark">
							买方手续费:¥{{ item.totalFee }},
							卖方手续费:¥{{ item.tradeFee_S }}
						</view> -->
						<view class="fs-xxs ft-dark">
							{{ $api.format(item.createTime, 'yyyy-MM-dd hh:mm') }}
						</view>
					</view>
				</view>
				<view class="dflex-c dflex-flow-c">
					<view class=""><view class="fwb">{{item.quantity}}✖{{item.price }}￥</view></view>
					<!-- <view class="bg-base border-radius fs-xs" @click="confirmOrder(item)" style="padding: 4rpx 15rpx;">
						确认提现
					</view> -->
				</view>
			</view>
			<view class="bg-base fs-xxs pos-a pos-top pos-right" style="border-bottom-left-radius: 20rpx; padding: 2rpx 10rpx;">
				{{zidian[item.status]}}
			</view>
		</view>
	</view>
</template>

<script>
	import {maker_record_list} from "../../../js_sdk/apis/user.js"
	export default {
		data() {
			return {
				empty: false,
				zidian:{
					1:"未成交",
					2:"已成交",
					3:"已撤单"
				},
				applyId:"",
				actionSheetShow: false,
				actionSheetList: [],
				actionSheetTips: {
					text: "选择提现银行卡",
					color: "#9a9a9a",
					size: 24
				},
				datas: []
			};
		},
		onLoad(options) {
			this.loadData();
		},
		methods: {
			confirmOrder(item){
				let {applyId} =item
				protocol_trade_confirm({applyId})
			},
			// 加载商品，下拉刷新|上拉加载
			async loadData() {
				maker_record_list({offset:1000}).then(res => {
					console.log(res)
					this.datas=res.data&&res.data.content&&res.data.content.list
					this.empty = !(this.datas && this.datas.length > 0);
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #f5f5f5;
	}
	/* 订单状态区 */
	.navbar-area {
		white-space: nowrap;
	}

	.state-area {
		height: 7vh;
		box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
	}

	.nav-item {
		flex: 1;

		&.active {
			&:after {
				content: '';
				position: absolute;
				left: 50%;
				transform: translate(-50%);
				bottom: 0;
				width: 44px;
				height: 0;
				border-bottom: 2px solid $base-color;
			}
		}
	}

</style>
